import unittest
from parameterized import parameterized
from test04_tools import add
from common.read_data import build_add_data1, build_add_data2, build_add_data3

data = [(1, 2, 3), (2, 5, 7), (4, 5, 9), (3, 3, 6)]

class TestAdd(unittest.TestCase):
    @parameterized.expand(data)
    def test_add1(self, a, b, expect):
        self.assertEqual(expect, add(a, b))

    @parameterized.expand(build_add_data1())
    def test_add2(self, a, b, expect):
        self.assertEqual(expect, add(a, b))

    @parameterized.expand(build_add_data2())
    def test_add3(self, a, b, expect):
        self.assertEqual(expect, add(a, b))

    @parameterized.expand(build_add_data3())
    def test_add4(self, a, b, expect):
        self.assertEqual(expect, add(a, b))

if __name__ == '__main__':
    unittest.main()
